home *** CD-ROM | disk | FTP | other *** search
- // ******************************************************************
- //
- // queryres.cpp : implementation file
- //
- // Implemented classes:
- // CQueryResultDlg
- //
- // Author: Nils Behncke
- // POET Software, August 1993
- //
- // ******************************************************************
-
- #include <stdafx.h> // header to MFC
- #include <queryres.h> // header to this file
-
- #ifdef _DEBUG // added by ClassWizard
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CQueryResultDlg dialog
-
- CQueryResultDlg::CQueryResultDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CQueryResultDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CQueryResultDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
- CQueryResultDlg::~CQueryResultDlg ()
- {
- }
-
-
- void CQueryResultDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CQueryResultDlg)
- DDX_Control(pDX, IDC_LIST_RESULT, m_CListResult);
- //}}AFX_DATA_MAP
- }
-
- BEGIN_MESSAGE_MAP(CQueryResultDlg, CDialog)
- //{{AFX_MSG_MAP(CQueryResultDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- void CQueryResultDlg::Init ()
- {
- int erc;
-
- for ( erc = presult->Seek ( 0L, PtSTART ); erc == 0; )
- {
- PersonOnDemand ondem;
- if ((erc = presult->Get ( ondem ) ) == 0 )
- {
- char buffer[500];
-
- if ((erc = ondem.Get (person)) == 0) // get Person or Programmer
- {
- m_CListResult.AddString (CString (person->Print ( buffer ) )); // add to Listbox
- ondem.Unget (person);
- }
-
- presult->Unget ( ondem );
- erc = presult->Seek ( 1L, PtCURRENT );
- }
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CQueryResultDlg message handlers
-
- BOOL CQueryResultDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- Init (); // set result in Listbox
-
- return TRUE; // return TRUE unless you set the focus to a control
- }
-
- // OK and CANCEL button with standard-IDs like IDOK or IDCANCEL automaticly handled
-